<template>
    <div class="officialActivity_wrap" v-if="ActivityInfoData">
        <!-- <div class="title">{{ActivityInfoData.title}}</div>
				<div class="title-info">
					<div class="write">恋恋酱</div>
					<div class="time">{{ActivityInfoData.createDate | transformTime}}</div>
				</div> -->
				<div class="detail-content" v-html="ActivityInfoData.refContent"></div>
    </div>
</template>

<script>
import transformTime from '@/filters/transformTime'
export default {
    data() {
        return {
            ActivityInfoData: null,
        }
    },
    async created() {
		console.warn('userId', this.$env.userId);
		
        let res = await this.$http(`/lovelorn/v1/pb/activity-info/${this.$route.params.id}`);
        let data = res.data.data;
        this.ActivityInfoData = data || {};
        // console.log('this.ActivityInfoData', this.ActivityInfoData);
		let { title, description, kid, coverUrl } = this.ActivityInfoData;
		if (this.$utils.isWeiXin()) {
			this.$utils.wxShare({
				title: title,
				desc: description || '生活的点滴都值得诉说',
				link: `${window.location.origin}/official-activity-share/${kid}`,
				imgUrl: coverUrl || 'https://cdn.yryz.com/lovelorn/image/public/201901/default%403x.png', 
			})
		}
    }
}
</script>

<style type="text/css" scoped>
  @import "../../css/var.css";

  .officialActivity_wrap {
		background: #fff;
		min-height: 100vh;
		padding: 0.3rem 0.2rem;
		& .title {
			font-size: .38rem;
			line-height: .5rem;
			font-weight: 700;
			color: #000
		}
		& .title-info{
			flex: 1;
			display: flex;
			flex-direction: row;
			align-items: center;
			justify-content: space-between;
			margin-top: .1rem;
			margin-bottom: .5rem;
			& .write{
				font-size: 0.24rem;
				color: #fff;
				background: #ff3988;
				border-radius: 0.1rem;
				padding: .04rem .12rem;
				text-align: center
		
				
			}
			& .time{
				font-size: 0.24rem;
				color: #999;
			}
		}
		& .detail-content{
			padding: .3rem 0;
			font-size: .32rem;
		}
   
  }

</style>
